"Bazel dependencies"

module(
    name = "aspect_rules_aws",
    version = "0.6.1",
    compatibility_level = 1,
)

# Lower-bound dependency versions.
# Do not change unless the rules no longer work with the current version.
# Needed for #804 Use statically-linked bsdtar on all platforms
bazel_dep(name = "aspect_bazel_lib", version = "2.6.1")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_oci", version = "1.7.4")
bazel_dep(name = "rules_python", version = "0.29.0")

# Development dependencies which are not exposed to users
bazel_dep(name = "aspect_rules_py", version = "0.7.3", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0", dev_dependency = True)
bazel_dep(name = "container_structure_test", version = "1.16.0", dev_dependency = True)

bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
bazel_lib_toolchains.jq()
bazel_lib_toolchains.coreutils()
use_repo(bazel_lib_toolchains, "coreutils_toolchains", "jq_toolchains")

register_toolchains(
    "@jq_toolchains//:all",
    "@coreutils_toolchains//:all",
)

aws = use_extension("//aws:extensions.bzl", "aws")
aws.toolchain(aws_cli_version = "2.13.0")
use_repo(aws, "aws", "aws_darwin", "aws_linux-aarch64", "aws_linux-x86_64", "aws_toolchains")

oci = use_extension(
    "@rules_oci//oci:extensions.bzl",
    "oci",
    dev_dependency = True,
)
oci.pull(
    name = "ubuntu",
    digest = "sha256:0bced47fffa3361afa981854fcabcd4577cd43cebbb808cea2b1f33a3dd7f508",  # tag = "latest" on 13 July 2023
    image = "ubuntu",
    platforms = [
        "linux/amd64",
        "linux/arm64/v8",
    ],
)
use_repo(oci, "ubuntu")

register_toolchains("@aws_toolchains//:all")

aws_py_lambda = use_extension(
    "@aspect_rules_aws//aws:repositories.oci.bzl",
    "aws_py_lambda",
    dev_dependency = True,
)
use_repo(aws_py_lambda, "aws_lambda_python")

pip = use_extension(
    "@rules_python//python/extensions:pip.bzl",
    "pip",
    dev_dependency = True,
)
pip.parse(
    hub_name = "pip",
    python_version = "3.11",
    requirements_lock = "//examples/python_lambda:requirements.txt",
)
use_repo(pip, "pip")
